﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Windows.Forms;

namespace com.lover.astd.updater
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            // 先检查有没有astd.exe的进程, 如果有, 那么提示并退出
            Process[] processes;
            processes = Process.GetProcesses();
            foreach (Process p in processes)
            {
                try
                {
                    if (p.ProcessName.Equals("astd"))
                    {
                        MessageBox.Show("请先结束所有astd.exe进程, 然后再进行更新", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        Environment.Exit(1);
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine(String.Format("ERROR::{0}::{1}", ex.Message, ex.StackTrace));
                }
            }
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainForm());
        }
    }
}
